<?php
/**
 * Created by PhpStorm.
 * User: ahao
 * Email: 827316006@qq.com
 * Date: 2019/12/3 22:17
 */

go(function () {
    $client = new Swoole\Coroutine\Client(SWOOLE_SOCK_TCP);
    if (!$client->connect('0.0.0.0',9501)) {
        echo "链接失败：" . $client->errCode . PHP_EOL;
    } else {
        $client->send("ahao带领大家测试协程客户端\n");
        echo $client->recv();
        $client->close();
    }
});